home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Softdisk Supreme
/
Softdisk Supreme.iso
/
pc
/
DSK Files
/
0-49
/
SD004b.dsk
/
IT.bas
< prev
next >
Wrap
BASIC Source File
|
2003-06-12
|
4KB
|
172 lines
1000 REM IT IT IT IT IT IT IT
1010 REM
1020 REM ASSUMES 48K APPLE
1030 REM AND DOS 3.3
1040 REM
1050 PRINT CHR$(4)"MAXFILES3"
1060 HIMEM: 36864: REM $9000
1070 REM
1080 REM DEFINITIONS
1090 REM
1100 REM F$ DIRECTORY ENTRY
1110 REM TY$() FILE TYPE TABLE
1120 REM FL$() FILE NAME TABLE
1130 REM E FILE TABLE INDEX
1140 REM T DIR ENTRY OFFSET
1150 REM T3 FILE NAME OFFSET
1160 REM X LOOP CONTROL
1170 REM F FILE NAME CTR
1180 REM N$ SELECTION NUMBER
1190 REM N MEMORY OFFSET
1200 REM H MEMORY VALUE
1210 REM HI DELETED ENTRY
1220 REM LO UNUSED ENTRY
1230 REM RWTS ASSY PGM PTR
1240 REM BUF BUFFER PTR
1250 REM SP STRING PTR
1260 REM DR$ DRIVE NUMBER
1270 REM S SECTOR NUMBER
1280 REM CD$() FILE CMD TYPE
1290 REM
1300 REM DECLARE F$ FIRST
1310 REM
1320 LET F$ = "FILENAME"
1330 LET HI = 255
1340 LET LO = 0
1350 LET RWTS = 36864
1360 LET BUF = RWTS +256
1370 DIM FL$(107),TY(107)
1380 LET SP = PEEK(105) +256 * PEEK(106)
1390 LET D$ = CHR$(13) + CHR$(4)
1400 LET CD$(0) = "EXEC": REM TEXT
1410 REM
1420 LET CR$(1) = "RUN": REM INTEGER
1430 LET CD$(2) = "RUN": REM APPLESOFT
1440 LET CD$(4) = "BRUN": REM BINARY
1450 REM
1460 REM SET UP FOLLOWING CODE
1470 REM
1480 REM RWTS ORG $9000
1490 REM PHA
1500 REM TXA
1510 REM PHA
1520 REM TYA
1530 REM PHA
1540 REM LDA #$90
1550 REM LDY #$12
1560 REM JSR $03D9
1570 REM PLA
1580 REM TAY
1590 REM PLA
1600 REM TAX
1610 REM PLA
1620 REM RTS
1630 REM
1640 REM IOCB
1650 REM
1660 REM IBTYPE HEX 01
1670 REM IBSLOT HEX 60
1680 REM IBDRVN HEX 00
1690 REM IBVOL HEX 00
1700 REM IBTRK HEX 00
1710 REM IBSECT HEX 00
1720 REM IBDCTP ADR DEVTPC
1730 REM IBBUFP EQU $9100
1740 REM IBRESV HEX 00
1750 REM IBCNT HEX 00
1760 REM IBCMD HEX 01
1770 REM IBSTAT HEX 00
1780 REM IBSMOD HEX 00
1790 REM IOBPSN HEX 60
1800 REM IOBPDN HEX 00
1810 REM
1820 REM DCT
1830 REM
1840 REM DEVTPC HEX 00
1850 REM PPTC HEX 01
1860 REM MONTC HEX EFD8
1870 REM
1880 DATA 72,138,72,152,72,169,144,160,18,32,217,3,104,168,104,170,104,96,1,96,0,0,0,0,35,144,0,145,0,0,1,0,0,96,0,0,1,239,216
1890 RESTORE
1900 FOR N = 0 TO 38
1910 READ H
1920 POKE N +RWTS,H
1930 NEXT N
1940 REM
1950 REM SET UP IOCB DATA
1960 REM
1970 POKE SP +2,30
1980 POKE SP +4,145
1990 POKE RWTS +34, PEEK(47096)
2000 POKE RWTS +22,17
2010 TEXT
2020 HOME
2030 LET FL$(0) = "(EXIT PROGRAM)"
2040 LET FL$(1) = "(CATALOG OF DRIVE 1)
2050 LET FL$(2) = "(CATALOG OF DRIVE 2)
2060 LET DR$ = "1"
2070 LET S = 15:E = 2:DR = VAL(DR$)
2080 HOME
2090 VTAB 12
2100 HTAB 12
2110 PRINT "READING DRIVE ";DR$
2120 REM 43624 IS DOS DRIVE #
2130 POKE RWTS +20,DR
2140 POKE 43524,DR
2150 POKE RWTS +23,S
2160 CALL RWTS
2170 LET F = 0
2180 LET T = 11 +35 *F
2190 LET T3 = T +3
2200 POKE SP +3,T3
2210 IF PEEK(BUF +T3) = LO THEN 2320: REM ALL DONE
2220 IF PEEK(BUF +T) = HI THEN 2280: REM DELETED FILE
2230 LET E = E +1
2240 LET FL$(E) = F$
2250 LET TY = PEEK(BUF +T +2)
2260 IF TY = >127 THEN TY = TY -128
2270 LET TY(E) = TY
2280 LET F = F +1
2290 IF F <7 THEN 2180
2300 LET S = S -1
2310 IF S >0 THEN 2150
2320 HOME
2330 INVERSE
2340 PRINT " CATALOG : DRIVE ";DR$;" "
2350 INVERSE
2360 PRINT " "
2370 LET P = 0
2380 NORMAL
2390 FOR X = 0 TO E
2400 INVERSE
2410 IF X = 3 THEN PRINT " ";: NORMAL : PRINT " --------------------": INVERSE
2420 IF X <10 THEN PRINT " ";
2430 IF X <100 THEN PRINT " ";
2440 PRINT X;
2450 NORMAL
2460 PRINT " ";FL$(X)
2470 LET P = P +1
2480 IF P = 19 THEN VTAB 24: INPUT "PRESS RETURN FOR MORE ";A$:P = 0: HOME
2490 NEXT X
2500 INVERSE
2510 PRINT " "
2520 NORMAL
2530 INVERSE
2540 INPUT " <-ENTER SELECTION ";N$
2550 NORMAL
2560 LET S = VAL(N$)
2570 IF STR$(S) < >N$ THEN 2320
2580 IF S <0 OR S >E THEN 2320
2590 IF S = 1 THEN 2060
2600 IF S = 2 THEN DR$ = "2": GOTO 2070
2610 HIMEM: 38400
2620 IF S = 0 THEN HOME : PRINT "THAT'S ALL FOLKS ...": END
2630 HOME
2640 HTAB 12
2650 VTAB 12
2660 PRINT CD$(TY(S));" ";FL$(S)
2670 ON TY(S) +2 GOTO 2680,2690,2700,2700,2680,2710
2680 PRINT "UNKNOWN TYPE OF FILE": END
2690 PRINT D$;"EXEC ";FL$(S);",D";DR$: END
2700 PRINT D$;"RUN ";FL$(S);",D";DR$: END
2710 PRINT D$;"BRUN ";FL$(S);",D";DR$: END